import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 名单推送配置信息 */
export interface PushListConfig {
          id: number; // ID
          rechargeTenantId?: number; // 租户ID
          listLevel?: number; // 名单等级（如：1/2/3）
          pullCount?: number; // 拉取条数
          enabled?: boolean; // 是否启用 1=启用 0=停用
  }

// 名单推送配置 API
export const PushListConfigApi = {
  // 查询名单推送配置分页
  getPushListConfigPage: async (params: any) => {
    return await request.get({ url: `/vos/push-list-config/page`, params })
  },

  // 查询名单推送配置详情
  getPushListConfig: async (id: number) => {
    return await request.get({ url: `/vos/push-list-config/get?id=` + id })
  },

  // 新增名单推送配置
  createPushListConfig: async (data: PushListConfig) => {
    return await request.post({ url: `/vos/push-list-config/create`, data })
  },

  // 修改名单推送配置
  updatePushListConfig: async (data: PushListConfig) => {
    return await request.put({ url: `/vos/push-list-config/update`, data })
  },

  // 删除名单推送配置
  deletePushListConfig: async (id: number) => {
    return await request.delete({ url: `/vos/push-list-config/delete?id=` + id })
  },

  /** 批量删除名单推送配置 */
  deletePushListConfigList: async (ids: number[]) => {
    return await request.delete({ url: `/vos/push-list-config/delete-list?ids=${ids.join(',')}` })
  },

  // 导出名单推送配置 Excel
  exportPushListConfig: async (params) => {
    return await request.download({ url: `/vos/push-list-config/export-excel`, params })
  },
}